// 获取资源的文件类型
// 不够完全正确，由于地址的可能性种类过多

export default function getExt(url) {
  if (typeof url !== "string") {
    return;
  }
  const [source] = url.split("?");
  const [, ret = ""] = source.match(/.([^.]+)$/);
  return ret.toLowerCase();
}

// console.log(
//   getExtByUrl(
//     "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1605282034809&di=47ac529becb3d81c31960dc1474e215b&imgtype=0&src=http%3A%2F%2Fimage001.fuwuqizhijia.com%2F20170311%2F595eaafdf0432358b22e40c48647b0c2.jpg"
//   )
// );
